<template>
    <div class="container">
        <div class="header">
            <div class="logo-box">
                <img class="logo-img" src="./../../public/images/zzkylogo2.svg">
            </div>
        </div>
        <div class="center">
            <div class="left">
                
                <router-link to="/home">
                    <div class="left-item" :class="{active: 1 == current}" @click="option(1)"><img class="icon-img" src="./../assets/icons/house.svg"/>首页</div>
                </router-link>

                <!--
                <router-link to="/setting">
                    <div class="left-item" :class="{active: 2 == current}" @click="option(2)"><img class="icon-img" src="./../assets/icons/gear.svg"/>设置</div>
                </router-link>
                -->
                <router-link to="/user">
                    <div class="left-item" :class="{active: 3 == current}" @click="option(3)"><img class="icon-img" src="./../assets/icons/people.svg"/>用户</div>
                </router-link>

                <router-link to="/library">
                    <div class="left-item" :class="{active: 4 == current}" @click="option(4)"><img class="icon-img" src="./../assets/icons/file.svg"/>文库</div>
                </router-link>

                <router-link to="/book">
                    <div class="left-item" :class="{active: 5 == current}" @click="option(5)"><img class="icon-img" src="./../assets/icons/upload.svg"/>题库</div>
                </router-link>

                <router-link to="/post">
                    <div class="left-item" :class="{active: 6 == current}" @click="option(6)"><img class="icon-img" src="./../assets/icons/card-heading.svg"/>帖子</div>
                </router-link>
            </div>
            <div class="right">
                <router-view />
            </div>
        </div>

    </div>
</template>

<script>
    export default {
        name:"Index",
        data(){
            const item = {
                date: '2016-05-02',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1518 弄'
            };
            return {
                tableData: Array(20).fill(item),
                current:1,
            }
        },
        mounted(){
            this.init();
        },
        methods:{
            init(){

            },
            option(optionItem){
                this.current = optionItem;
            }
        }
    }
</script>

<style lang="scss">
    @import './../assets/scss/index.scss';
</style>